<div class="modal-header">
    <h3 class="modal-title">持续集成应用-授权配置</h3>
</div>
<div class="modal-body">
    <form class="form-horizontal">
        <div class="form-group">
            <label class="col-lg-2 control-label"><span style="color: #ec2121;">*</span>用户名</label>
            <div class="col-lg-4">
                <ui-select ng-model="nowUser.selected" theme="bootstrap">
                    <ui-select-match placeholder="搜索用户名称......">{{$select.selected.username}}</ui-select-match>
                    <ui-select-choices refresh="queryUser($select.search)" refresh-dalay="0" repeat="item in userList | filter: $select.search">
                        <div ng-bind-html="item.username | highlight: $select.search"></div>
                    </ui-select-choices>
                </ui-select>
            </div>
            <div class="col-lg-2">
                <button ng-click="addUser()"
                        class="btn btn-xs"
                        style="margin-left: 5px;margin-top:5px; background-color: #2e6da4; color: white;">
                    <span class="glyphicon glyphicon-plus"></span>添加</button>
            </div>
        </div>
    </form>

    <div style="margin-top: 5px;">
        <table class="table table-hover table-bordered table-striped">
            <thead>
            <tr>
                <td class="col-md-3">授权用户</td>
                <td class="col-md-3">姓名</td>
                <td class="col-md-4"><b style="color: #286090">Email</b>
                </td>
                <td class="col-md-2">操作</td>
            </tr>
            </thead>
            <tbody>
            <tr ng-repeat="item in pageData">
                <td>{{item.username}}</td>
                <td>{{item.displayName}}</td>
                <td>{{item.mail}}</td>
                <td>
                    <button ng-click="delUser(item.id)"
                            class="btn btn-xs pull-right"
                            uib-popover-html="'解除授权'" popover-trigger="'mouseenter'"
                            style="background-color: red; color: white;">
                        <span class="glyphicon glyphicon-log-out"></span>解除</button>
                </td>
            </tr>
            </tbody>
            <tfoot>
            <tr>
                <td colspan="4">
                    <ul style="margin: 0px; float: right;" uib-pagination total-items="totalItems" ng-model="currentPage" items-per-page="pageLength" max-size="10" ng-change="pageChanged(currentPage)" previous-text="&lsaquo;" next-text="&rsaquo;"></ul>
                </td>
            </tr>
            </tfoot>
        </table>
    </div>
    <div ng-if="alert.type != ''">
        <div uib-alert ng-class="'alert-' + alert.type" close="closeAlert()">{{alert.msg}}</div>
    </div>
</div>